<?php
/**
 * 遮罩控制器
 *
 * 遮罩controller
 *
 * @author    zhouchao <zhouchao@yunys.com.cn>
 * @copyright 2016 QuanZhouYunYiShang Inc.
 */
namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Services\MasksService\MasksService;
use Response;

class MasksController extends Controller
{
    protected $masks_service;
    public function __construct(MasksService $masks_service)
    {
        $this->masks_service = $masks_service;
    }

    /**
     * 获取遮罩列表
     * @param Request $request
     * @return mixed
     */
    public function postList(Request $request){
        $per_page = intval($request->input('per_page')) > 0 ? intval($request->input('per_page')) : 10;
        $result = $this->masks_service->getMasks($per_page);
        return Response::json($result);
    }
}
